<!--  -->
<template>
  <div class>
    <div id="content" class="container">
      <!---->
      <KPTop title="我的邀请码"></KPTop>
      <div class="promocode-box borderbox">
        <div class="item-box">
          <div class="item-left">
            <div class="value">{{msg.code}}</div>
            <div class="tit">我的邀请码</div>
            <div class="btn-copy">复制</div>
          </div>
          <div class="item-right">
            <div class="value">￥{{msg.invite_user_reward}}</div>
            <div class="tit">邀请奖励金</div>
            <!---->
          </div>
        </div>
        <div class="info">
          <p>邀请者分享邀请链接给其他人下单成功后，将的到如下对应金额奖励：</p>
          <p>邀请人奖励：{{msg.invite_user_reward}}元</p>
          <p>被邀请人奖励：{{msg.invited_user_reward}}元</p>
          <p>订单抽成：{{msg.per_order_draw}}%</p>
        </div>
      </div>
      <div class="type-box borderbox">
        <div :class="num==1?'item active':'item'" @click.stop="changeNum(1)">
          邀请记录
          <div class="actline"></div>
        </div>
        <div :class="num==2?'item active':'item'" @click.stop="changeNum(2)">
          资金明细
          <div class="actline"></div>
        </div>
        <div :class="num==3?'item active':'item'" @click.stop="changeNum(3)">
          提现明细
          <div class="actline"></div>
        </div>
      </div>
      <div class="list-box borderbox">
        <div class="none gray">
          <div class="empty-box">
            <div class="image-empty-item">
              <img src="@/assets/img/img-placeholder.png" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import KPTop from "@/components/KPTop.vue";
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: { KPTop },
  data() {
    //这里存放数据
    return {
      msg: {},
      num: 1
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    changeNum: function(num) {
      this.num = num;
    }
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {
    this.$request.get("/api/v2/member/promoCode").then(res => {
      console.log(res.data);
      this.msg = res.data;
    });
  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang='less' scoped>
#content.container {
  box-sizing: border-box;
  padding-top: 50px;
  background: #f6f6f6;
  position: absolute;
  left: 0;
  top: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  width: 100%;
  height: 100%;
  .promocode-box.borderbox {
    width: 100%;
    max-height: 355px;
    background: #1784ed;
    padding: 30px 15px 20px 15px;
    .item-box {
      width: 345px;
      background: linear-gradient(180deg, #fff6cf, #ffeaa1);
      border-radius: 4px;
      margin: 0 auto;
      display: flex;
      flex-direction: row;
      .item-left {
        width: 50%;
        display: flex;
        flex-direction: column;
        padding-top: 30px;
        padding-bottom: 30px;
        padding-left: 15px;
        box-sizing: border-box;
        .value {
          width: 100%;
          font-size: 20px;
          font-weight: 500;
          color: #333;
          line-height: 20px;
          margin-bottom: 20px;
          text-align: center;
        }

        .tit {
          display: inline-block;
          width: auto;
          height: 13px;
          font-size: 13px;
          font-weight: 400;
          color: #666;
          line-height: 13px;
          margin-left: 50px;
        }

        .btn-copy {
          width: 96px;
          height: 30px;
          border-radius: 15px;
          border: 1px solid #1784ed;
          cursor: pointer;
          margin-top: 20px;
          font-size: 14px;
          font-weight: 400;
          color: #1784ed;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-left: 50px;
        }
      }

      .item-right {
        width: 50%;
        display: flex;
        flex-direction: column;
        padding-top: 30px;
        padding-bottom: 30px;
        padding-right: 15px;
        box-sizing: border-box;
        .value {
          width: 100%;
          font-size: 20px;
          font-weight: 500;
          color: #333;
          line-height: 20px;
          margin-bottom: 20px;
          text-align: center;
        }

        .tit {
          display: inline-block;
          width: auto;
          height: 13px;
          font-size: 13px;
          font-weight: 400;
          color: #666;
          line-height: 13px;
          margin-left: 50px;
        }
      }
    }

    .info {
      width: 100%;
      height: 119px;
      display: flex;
      flex-direction: column;
      margin-top: 22px;
      p {
        width: 100%;
        font-size: 13px;
        font-weight: 400;
        color: #fff;
        line-height: 19px;
        margin-bottom: 8px;
      }
    }
  }

  .type-box.borderbox {
    width: 100%;
    height: 54px;
    background-color: #fff;
    display: flex;
    flex-direction: row;
    justify-content: center;
    .item.active {
      color: #3ca7fa;
      font-weight: 600;
      .actline {
        width: 56px;
        height: 4px;
        background: #3ca7fa;
      }
    }

    div.item {
      min-width: 56px;
      height: 34px;
      cursor: pointer;
      text-align: center;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      font-size: 14px;
      font-weight: 400;
      color: #666;
      margin-right: 64px;
      margin-top: 20px;
    }
  }

  .list-box.borderbox {
    width: 100%;
    display: flex;
    flex-direction: column;
    .none.gray {
      background-color: #f6f6f6;
      width: 100%;
      height: 100%;
      float: left;
      .empty-box {
        width: 100%;
        height: auto;
        float: left;
        text-align: center;
        padding-top: 50px;
        padding-bottom: 50px;
        .image-empty-item {
          display: inline-block;
          text-align: center;
          width: 120px;
          height: 120px;
          img {
            width: 120px;
            height: 120px;
          }
        }
      }
    }
  }
}
</style>